<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>
<body>
    <script>
        //Math为JS的原生对象，提供了一些功能，可直接调用
        var a = -1;
        console.log(a);

        //abs返回绝对值，max返回最大值，min返回最小值
        console.log(Math.abs(a));
        console.log(Math.max(2, -1, 5));
        console.log(Math.min(2, -1, 5));
        console.log(Math.min());
        console.log(Math.max());

        //floor向下取整，ceil向下取整
        var num = 10.1;
        console.log(Math.floor(num));
        console.log(Math.ceil(num));
        //取>=0, <1的伪随机数
        console.log(Math.random())


    </script>
</body>
</html>